package com.lk.ii.service.impl;

import java.util.List;
import com.lk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.ii.mapper.IiResearchReportMapper;
import com.lk.ii.domain.IiResearchReport;
import com.lk.ii.service.IIiResearchReportService;
import com.lk.common.core.text.Convert;

/**
 * 研究报告Service业务层处理
 * 
 * @author lk
 * @date 2021-02-22
 */
@Service
public class IiResearchReportServiceImpl implements IIiResearchReportService 
{
    @Autowired
    private IiResearchReportMapper iiResearchReportMapper;


    @Override
    public List<IiResearchReport> getResearchReportPageList(Long pageSize, Long offset)
    {
        return iiResearchReportMapper.getResearchReportPageList(pageSize, offset);
    }

    /**
     * 查询研究报告
     * 
     * @param id 研究报告ID
     * @return 研究报告
     */
    @Override
    public IiResearchReport selectIiResearchReportById(Long id)
    {
        return iiResearchReportMapper.selectIiResearchReportById(id);
    }

    /**
     * 查询研究报告列表
     * 
     * @param iiResearchReport 研究报告
     * @return 研究报告
     */
    @Override
    public List<IiResearchReport> selectIiResearchReportList(IiResearchReport iiResearchReport)
    {
        return iiResearchReportMapper.selectIiResearchReportList(iiResearchReport);
    }

    /**
     * 新增研究报告
     * 
     * @param iiResearchReport 研究报告
     * @return 结果
     */
    @Override
    public int insertIiResearchReport(IiResearchReport iiResearchReport)
    {
        iiResearchReport.setCreateTime(DateUtils.getNowDate());
        return iiResearchReportMapper.insertIiResearchReport(iiResearchReport);
    }

    /**
     * 修改研究报告
     * 
     * @param iiResearchReport 研究报告
     * @return 结果
     */
    @Override
    public int updateIiResearchReport(IiResearchReport iiResearchReport)
    {
        iiResearchReport.setUpdateTime(DateUtils.getNowDate());
        return iiResearchReportMapper.updateIiResearchReport(iiResearchReport);
    }

    /**
     * 删除研究报告对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIiResearchReportByIds(String ids)
    {
        return iiResearchReportMapper.deleteIiResearchReportByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除研究报告信息
     * 
     * @param id 研究报告ID
     * @return 结果
     */
    @Override
    public int deleteIiResearchReportById(Long id)
    {
        return iiResearchReportMapper.deleteIiResearchReportById(id);
    }
}
